package com.linran.lin.excel; //

import com.alibaba.excel.EasyExcel;
import com.linran.lin.bo.ExcelBO;
import com.linran.lin.utils.ExcelListener;

import java.io.FileNotFoundException;
import java.util.List;

/**
 * excel导出相关操作
 *
 *         <dependency>
 *             <groupId>com.alibaba</groupId>
 *             <artifactId>easyexcel</artifactId>
 *             <version>${easyexcel.version}</version>
 *         </dependency>
 */
public class ExcelParseDemo {

    public static void main(String[] args) throws FileNotFoundException {
        // 导入
        String path = "D:\\zoulin21\\Downloads\\中台客户输入4.28-5.05.xlsx";
        List<ExcelBO> list = EasyExcel.read(path, ExcelBO.class, new ExcelListener()).sheet().doReadSync();

        // 导出
        String outPath = "D:\\zoulin21\\Downloads\\输出文件.xlsx";
        EasyExcel.write(outPath, ExcelBO.class).sheet("用户列表").doWrite(list);
    }
}
